package com.zjuh.goodboy.claw.link;

import java.io.Serializable;
import java.util.Date;

import com.zjuh.goodboy.util.URLUtil;
import com.zjuh.sweet.codec.MD5;

public class Link implements Serializable {
	
	private static final long serialVersionUID = -3131887300964933940L;

	private long id;
	
	private String url;
	
	private String label;
	
	private Date lastClawDate;
	
	public Link() {
		super();
	}

	public Link(String url, String label) {
		super();
		this.url = url;
		this.label = label;
	}
	
	public String getHostname(){
		return URLUtil.getHostname(url);
	}

	@Override
	public String toString() {
		return "Link [label=" + label + ", url=" + url + "]";
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getToken() {
		return MD5.encrypt(url);
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Date getLastClawDate() {
		return lastClawDate;
	}

	public void setLastClawDate(Date lastClawDate) {
		this.lastClawDate = lastClawDate;
	}


}
